<?php

function tf_create_php_file_comments() {
  global $thfr_css;

  return '<?php // Do not delete these lines
if (!empty($_SERVER[\'SCRIPT_FILENAME\']) AND \'comments.php\' == basename($_SERVER[\'SCRIPT_FILENAME\'])) die (\'' . $thfr_css['commenttext']['dontloaddirectly'] . '\');
if ( post_password_required() ) { echo \'' . $thfr_css['commenttext']['passwordrequired'] . '\'; return; }

// You can start editing below:
?>
<div style="clear: both;"></div>
<section>
<div id="comments_block">
<a name="comments"></a><!-- named anchor for skip links -->
<?php
if ( have_comments() ) : ?>
  <h3 id="comments">' . $thfr_css['commenttext']['commentstitle'] . '</h3>
  ' . $thfr_css['nextprevnav']['comments'] . '
  <ul class="commentlist">
    <?php wp_list_comments(array(
      "avatar_size" => 50,
      "reply_text" => "' . $thfr_css['commenttext']['reply_text'] . '",
      "login_text" => "' . $thfr_css['commenttext']['login_text'] . '",
      "callback" => "thfr_comments",
      "type" => "all"
    )); ?>
  </ul>
  ' . $thfr_css['nextprevnav']['comments2'] . '

<?php
else : // If no comments  ?>

  <?php if ( (\'open\' == $post->comment_status) ) :  // If comments open ?>
    ' . $thfr_css['commenttext']['nocommentsyet'] . '
  <?php else : // If comments closed ?>
    ' . $thfr_css['commenttext']['commentsclosed'] . '
  <?php endif; ?>
  
<?php
endif; // END of "If no comments" ?>

<?php global $aria_req, $post_id, $required_text; // These values aren\'t available else:
// author, email and url fields are set in a separate variable first:
$fields =  array(
  \'author\' => \'Или заполнив поля: <input class="text author" id="author" name="author" type="text" value="\' . esc_attr( $commenter[\'comment_author\'] ) . \'" size="30"\' . $aria_req . \' tabindex="1" placeholder="' . strip_tags($thfr_css['commenttext']['authorlabel']) . '" />\',
  \'email\'  => \'<input class="text email" id="email" name="email" type="email" value="\' . esc_attr(  $commenter[\'comment_author_email\'] ) . \'" size="30"\' . $aria_req . \'  tabindex="2" placeholder="' . strip_tags($thfr_css['commenttext']['emaillabel']) . '"/>\',
);

// The rest is set here:
$comment_form_settings = array(
  \'fields\'               => apply_filters( \'comment_form_default_fields\', $fields ),
  \'comment_field\'        => \'<p><textarea name="comment" id="comment-textarea" rows="4" cols="80" tabindex="4"></textarea></p>\',
  \'must_log_in\'          => \'<p class="must-log-in">\' .  sprintf( __( \'' . $thfr_css['commenttext']['must_log_in'] . '\' ), wp_login_url( apply_filters( \'the_permalink\', get_permalink( $post_id ) ) ) ) . \'</p>\',
  \'logged_in_as\'         => \'<p class="logged-in-as">\' . sprintf( __( \'' . $thfr_css['commenttext']['logged_in_as'] . '\' ), admin_url( \'profile.php\' ), $user_identity, wp_logout_url( apply_filters( \'the_permalink\', get_permalink( $post_id ) ) ) ) . \'</p>\',
  \'comment_notes_before\' => \'' . $thfr_css['commenttext']['comment_notes_before'] . '\',
  \'comment_notes_after\'  => \'' . $thfr_css['commenttext']['comment_notes_after'] . '\',
  \'id_form\'              => \'commentform\',
  \'id_submit\'            => \'comment-submit\',
  \'title_reply\'          => \'' . $thfr_css['commenttext']['title_reply'] . '\',
  \'title_reply_to\'       => \'' . $thfr_css['commenttext']['title_reply_to'] . '\',
  \'cancel_reply_link\'    => \'' . $thfr_css['commenttext']['cancel_reply_link'] . '\',
  \'label_submit\'         => \'' . $thfr_css['commenttext']['label_submit'] . '\'
);

comment_form($comment_form_settings);
?>
  </div>
</section>
';
}

?>